package com.example.service.impl;

import com.example.mapper.WxbCustomerMapper;
import com.example.model.WxbCustomer;
import com.example.service.WxbCustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
@Transactional
public class WxbCustomerServiceImpl implements WxbCustomerService {

    @Autowired
    private WxbCustomerMapper wxbCustomerMapper;

    @Override
    public WxbCustomer findCustomerByLoginName(String loginName) {
        Example example = new Example(WxbCustomer.class);
        example.and().andEqualTo("loginName",loginName);
        return wxbCustomerMapper.selectOneByExample(example);
    }

    @Override
    public List<WxbCustomer> findAll() {
        return wxbCustomerMapper.selectAll();
    }

    @Override
    public WxbCustomer findByCustomerId(String customerId) {
        return wxbCustomerMapper.selectByPrimaryKey(customerId);
    }
}
